package com.markus.code.exam.同花顺;

import java.util.Scanner;

/**
 * Author:markusZhang
 * Date:Create in 2020/9/20 17:31
 * todo:
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNext()){
            int year = scanner.nextInt();
            int month = scanner.nextInt();
            int day = scanner.nextInt();
            int sum = 0;
            if (month < 1 || month > 12 ||day < 1 || day > 31){
                throw new RuntimeException("请输出正确的日期");
            }
            for (int i = 1;i<month;i++){
                switch (i){
                    case 1:
                    case 3:
                    case 5:
                    case 7:
                    case 8:
                    case 10:
                    case 12:
                        sum += 31;
                        break;
                    case 4:
                    case 6:
                    case 9:
                    case 11:
                        sum += 30;
                        break;
                    case 2:
                        if ((year % 4 == 0 && year %100 != 0) || year % 400 == 0){
                            sum += 29;
                        }else{
                            sum += 28;
                        }
                    default:
                        break;
                }
            }
            sum += day;
            System.out.println(year + "年" + month + "月" + day+"日是该年"+sum+"天");
        }
    }
}
